const dashboardInfo = require('../services/dashboardService')
// 首页获取酒吧在线桌数
exports.getOnlineTables = async (req, res) => {
  try {
    const barID = req.query.barID; // TODO:酒吧名重复怎么处理
    const barNumResult = await dashboardInfo.findOnlineTables(barID)//酒吧在线桌号查询逻辑
    res.status(200).send(barNumResult);
  } catch (error) {
    res.status(500).send(error);
  }
};

exports.getActivities = async (req, res) => {
    try {
        const barID = req.query.barID;
        const activityResults = await dashboardInfo.findActivities(barID)
        res.status(200).send(activityResults);
    } catch (error) {
        res.status(500).send(error);
    }
}

